﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucImage.ascx.cs" Inherits="WCrawler.Controls.ucImage" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<style type="text/css">

        
        td
        {
            vertical-align: top;
        }
        
        .style2
    {
        width: 86px;
    }
        
        </style>
        <div>
<asp:Button runat="server" Text="Add original url" ID="btnUploadImages0" 
    OnClick="btnUploadImages0_Click" Width="98px"></asp:Button>

            <asp:Button ID="btnLoginPhotobucket" runat="server" 
                onclick="btnLoginPhotobucket_Click" Text="Login" Width="55px" />
            <asp:Button ID="btnUploadToPhotobucket" runat="server" 
                onclick="btnUploadToPhotobucket_Click" Text="Upload Images" Width="98px" />
<asp:Button ID="btnGetIMGTags" runat="server" Text="Get img tags" 
    onclick="btnGetIMGTags_Click" Width="87px" />
</div>
<div style="width: 100%; height:500px; overflow:scroll">
    <asp:GridView runat="server" AutoGenerateColumns="False" CellPadding="2" 
    DataKeyNames="ImagePostId" DataSourceID="ImageLinqDataSource" 
    BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px" 
    ForeColor="Black" Width="100%" ID="gridViewPostImages" 
        onselectedindexchanged="gridViewPostImages_SelectedIndexChanged" 
        style="margin-top: 0px" onrowdatabound="gridViewPostImages_RowDataBound">
    <AlternatingRowStyle BackColor="PaleGoldenrod"></AlternatingRowStyle>
    <Columns>
        <asp:CommandField ShowDeleteButton="True" ShowEditButton="True">
        </asp:CommandField>
        <asp:TemplateField HeaderText="Original Image">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLinkOriginalUrl" NavigateUrl='<%#Eval("OriginalUrl") %>' runat="server">
                <asp:Image ID="OriginalUrl"  ImageUrl='<%#Eval("OriginalUrl") %>' runat="server" Width="40%" Height="40%" />
                </asp:HyperLink>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtOriginalUrl" runat="server" Text='<%#Bind("OriginalUrl")%>'></asp:TextBox>
            </EditItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="Image">
            <ItemTemplate>
                <asp:HyperLink ID="HyperLinkImageUrl" NavigateUrl='<%#Eval("ImageUrl") %>' runat="server">
                <asp:Image ID="ImageUrl"  ImageUrl='<%#Eval("ImageUrl") %>' runat="server" Width="40%" Height="40%" />
                </asp:HyperLink>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:TextBox ID="txtImageUrl" runat="server" Text='<%#Bind("ImageUrl")%>'></asp:TextBox>
            </EditItemTemplate>
        </asp:TemplateField>
        <asp:TemplateField HeaderText="IsPoster">
            <ItemTemplate>
                <asp:CheckBox ID="chkIsPoster" runat="server" Checked='<%#Bind("IsPoster")%>' Enabled="false"></asp:CheckBox>
            </ItemTemplate>
            <EditItemTemplate>
                <asp:CheckBox ID="chkEditIsPoster" runat="server" Checked='<%#Bind("IsPoster")%>'></asp:CheckBox>
            </EditItemTemplate>
        </asp:TemplateField>
    </Columns>
    <EmptyDataTemplate>
        <asp:Label ID="lblEmptySearch0" 
                        runat="server" Font-Bold="True" 
                        ForeColor="#0033CC">No Results Found....  
            </asp:Label>
    </EmptyDataTemplate>
    <FooterStyle BackColor="Tan"></FooterStyle>
    <HeaderStyle BackColor="Tan" BorderStyle="Solid" Font-Bold="True"></HeaderStyle>
    <PagerStyle HorizontalAlign="Center" BackColor="PaleGoldenrod" 
        ForeColor="DarkSlateBlue"></PagerStyle>
    <SelectedRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite">
    </SelectedRowStyle>
    <SortedAscendingCellStyle BackColor="#FAFAE7">
    </SortedAscendingCellStyle>
    <SortedAscendingHeaderStyle BackColor="#DAC09E">
    </SortedAscendingHeaderStyle>
    <SortedDescendingCellStyle BackColor="#E1DB9C">
    </SortedDescendingCellStyle>
    <SortedDescendingHeaderStyle BackColor="#C2A47B">
    </SortedDescendingHeaderStyle>
</asp:GridView>
</div>
<div>
<!-- Popup add new post image-->
    <asp:Button id="btnNewImagePopup" runat="server" style="display:none" />
    <ajaxToolkit:ModalPopupExtender ID="mpeNewImage" runat="server" 
        PopupControlID="PanelNewImage"
        TargetControlID="btnNewImagePopup"
        BackgroundCssClass="BackgroundStyle"
        >
    </ajaxToolkit:ModalPopupExtender>
    <asp:Panel ID="PanelNewImage" runat="server" BackColor="#ffffff"
       BorderColor="#dadada" BorderStyle="Solid" BorderWidth="4px"
       Width="800px" Font-Names="Arial" Font-Size="10pt">
       <div>
       </div>
   <table cellpadding="10" cellspacing="0" style="width: 100%">
      <tr>
         <td>
             <table style="width:100%;">
                <tr>
                     <td class="style2">
                         <asp:Label ID="Label2" runat="server" Text="Local Path"></asp:Label>
                     </td>
                     <td>
                         <asp:TextBox ID="txtLocalPath" runat="server" Width="100%"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style2">
                         <asp:Label ID="Label3" runat="server" Text="Image Title"></asp:Label>
                     </td>
                     <td>
                         <asp:TextBox ID="txtImageTitle" runat="server" Width="100%"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style2">
                         <asp:Label ID="Label4" runat="server" Text="Album"></asp:Label>
                     </td>
                     <td>
                         <asp:TextBox ID="txtAlbum" runat="server" Width="100%"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style2">
                         <asp:Label ID="Label8" runat="server" Text="Poster Image"></asp:Label>
                     </td>
                     <td>
                         <asp:TextBox ID="txtPrimaryImage" runat="server" Width="100%"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style2">
                         <asp:Label ID="Label5" runat="server" Text="Screenshots"></asp:Label>
                     </td>
                     <td>
                         <asp:TextBox ID="txtScreenShot" runat="server" Rows="5" TextMode="MultiLine" 
                             Width="100%"></asp:TextBox>
                     </td>
                 </tr>
                 <tr>
                     <td class="style2">
                         &nbsp;</td>
                     <td>
                         <asp:CheckBox ID="checkBoxIsOrginalImages" runat="server" Checked="True" 
                             Text="Is Original Images" />
                     </td>
                 </tr>
             </table>
         </td>
      </tr>
      <tr>
         <td align="center" valign="middle">
            <asp:Button ID="btnUploadImagePopup" runat="server" Text="Add Images" 
                 onclick="btnUploadImagePopup_Click" />
            <asp:Button ID="Button3" runat="server" Text="Cancel" /><br />
         </td>
      </tr>
   </table>
    </asp:Panel>
</div>
    
<div>
    <!-- Popup show full content-->
    <asp:Button id="btnIMGTagPopup" runat="server" style="display:none" />
    <ajaxToolkit:ModalPopupExtender ID="mdlIMGTagPopup" runat="server" 
        PopupControlID="PanelIMGTag"
        TargetControlID="btnIMGTagPopup"
        BackgroundCssClass="BackgroundStyle"
        >
    </ajaxToolkit:ModalPopupExtender>
    <asp:Panel ID="PanelIMGTag" runat="server" BackColor="#ffffff"
       BorderColor="#dadada" BorderStyle="Solid" BorderWidth="4px"
        Width="800px" Font-Names="Arial" Font-Size="10pt">
   <table cellpadding="10" cellspacing="0" style="width: 100%">
      <tr>
         <td>
             <asp:TextBox ID="txtIMGTags" runat="server" Rows="10" Width="100%" 
                 TextMode="MultiLine" Height="222px"></asp:TextBox>
         </td>
      </tr>
      <tr>
         <td align="center" valign="middle">
            <asp:Button ID="btnCancel" runat="server" Text="Cancel" /><br />
            <asp:Label ID="lblMessage" runat="server" Text=""></asp:Label>
         </td>
      </tr>
   </table>
    </asp:Panel>
</div>

<asp:LinqDataSource ID="ImageLinqDataSource" runat="server" 
    ContextTypeName="WCrawlerLib.LinqDataClassesDataContext" EnableDelete="True" 
    EnableUpdate="True" EntityTypeName="" TableName="ImagePosts" 
    onselecting="ImageLinqDataSource_Selecting">
</asp:LinqDataSource>


